package com.xuan.controller.pg;

import com.xuan.configuration.result.ResponseResult;
import com.xuan.configuration.result.ResponseResultEnum;
import com.xuan.dto.pg.qimen.PgQiMenDouZhuanXingYiDto;
import com.xuan.dto.pg.qimen.PgQiMenDto;
import com.xuan.service.pg.PgQiMenService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * 奇门排盘Controller
 */
@RestController
@RequestMapping("/pgQiMen")
public class PgQiMenController {

    @Autowired
    private PgQiMenService pgQiMenService; // 奇门排盘Service

//********************************************************************************************************************************

    /**
     * 开始排盘
     *
     * @param dto 奇门排盘数据接收类
     * @return 排盘结果
     */
    @PostMapping("/starts")
    public ResponseResult<Object> starts(@RequestBody PgQiMenDto dto) {

        Object vo = pgQiMenService.starts(dto);
        return ResponseResult.result(ResponseResultEnum.SUCCESS, vo);

    }

    /**
     * 斗转星移
     *
     * @param dto 奇门斗转星移数据接收类
     */
    @PostMapping("/douZhuanXingYi")
    public ResponseResult<Object> douZhuanXingYi(@RequestBody PgQiMenDouZhuanXingYiDto dto) {

        Object vo = pgQiMenService.douZhuanXingYi(dto);
        return ResponseResult.result(ResponseResultEnum.SUCCESS, vo);

    }


}
